<!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout}">

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>

    <title th:text="#{screen.success.header}">Generic Success View</title>
    <link href="../../static/css/cas.css" rel="stylesheet" th:remove="tag"/>
</head>

<body>
<main role="main" class="container mt-3 mb-3">
    <div layout:fragment="content" class="row">
        <div class="card-body">

            <div class="alert alert-success">
                <h2 th:utext="#{screen.success.header}">Log In Successful</h2>
                <p th:utext="#{screen.success.success(${principal.id})}">You, <strong>username</strong>, have successfully
                    logged into the Central Authentication Service. This is what CAS knows about you:However, you are seeing this page because CAS does not
                    know about your target destination and how to get you there. Examine the authentication request again
                    and make sure a target service/application that is authorized and registered with CAS is specified.</p>

                <p th:unless="${#maps.isEmpty(principal.attributes)}"><a data-toggle="collapse" href="#divAttributes" aria-expanded="false" aria-controls="divAttributes">Click here</a>
                    to view attributes resolved and retrieved for <strong><span th:utext="${principal.id}"/></strong>.</p>

                <p th:utext="#{screen.success.security}">When you are finished, for security reasons, please <a
                        href="logout">log out</a> and exit your web browser.</p>
            </div>
            <div class="collapse" id="divAttributes">
                <table id="attributesTable" class="table table-striped table-bordered mt-3">
                    <thead>
                    <tr>
                        <th>Attribute</th>
                        <th>Value(s)</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="attribute : ${principal.attributes}">
                        <td class="col-auto"><code><span th:utext="${attribute.key}"/></code></td>
                        <td class="col-auto"><code><span th:utext="${attribute.value}"/></code></td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
</main>
</body>
</html>
